package com.rogo.openapi.flickr.api
{
	import com.rogo.oauth.URLParam;
	import com.rogo.oauth.URLParams;
	import com.rogo.openapi.flickr.core.FlickrAPI;
	
	import flash.net.URLRequest;
	import flash.net.URLRequestMethod;
	
	/**
	 * flickr.test.login 接口
	 * 
	 * @author Rogo
	 */	
	public class Test extends FlickrAPI
	{
		public function Test()
		{
			super();
		}
		
		//--------------------------------------------------------------------------
		//
		//  Variables
		//
		//--------------------------------------------------------------------------
		
		//--------------------------------------------------------------------------
		//
		//  Methods
		//
		//--------------------------------------------------------------------------
		
		public function login(resultHandler:Function, errorHandler:Function):void
		{
			var urlParams:URLParams = new URLParams();
			urlParams.addParam(new URLParam('nojsoncallback', '1'));
			urlParams.addParam(new URLParam('format', 'json'));
			urlParams.addParam(new URLParam('oauth_token', oauthKey.oauth_token));
			urlParams.addParam(new URLParam('method', 'flickr.test.login'));
			
			var urlReq:URLRequest = getSignatureUrlReq(URLRequestMethod.GET, FLICKR_API_URL, 
				urlParams, oauthKey);
			load(urlReq, resultHandler, errorHandler);
		}
		
	}
}